/**
 * 
 */
package com.yidu.finance.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * 描述: 字符集编码过滤器
 * @author liandyao
 * @date 2019年9月25日 上午8:56:27
 * @version 1.0
 */

public class CharsetFilter implements Filter{
	


	@Override
	public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain)
			throws IOException, ServletException {
		
		arg0.setCharacterEncoding("UTF-8");
		arg1.setCharacterEncoding("UTF-8");
		
		//将控制权交给下一个过滤器或者交给Servlet
		chain.doFilter(arg0, arg1);
		
	}

	

	 

}
